// src/app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AccountModule } from './logical/account/account.module';
// import { AuthService } from './logical/auth/auth.service';
import { AuthModule } from './logical/auth/auth.module';
import { SequelizeModule } from '@nestjs/sequelize';
import db from '../config/db';
import { RpAccount } from './logical/account/entity/account.entity';
import { AccessoryModule } from './logical/accessory/accessory.module';
import { AccessoryEntity } from './logical/accessory/entity/accessory.entity';
import { LoginLogModule } from './logical/login-log/login-log.module';
import { RoleModule } from './logical/role/role.module';
import {
  RoleAccountEntity,
  RoleEntity,
  RoleMenuEntity,
} from './logical/role/entity/role.entity';
import { MenuEntity } from './logical/menu/entity/menu.entity';
import { MenuModule } from './logical/menu/menu.module';
import { OrgModule } from './logical/org/org.module';
import { RpOrgEntity } from './logical/org/entity/org.entity';
import { SysCodeEntity } from './logical/syscode/entity/syscode.entity';
import { SysCodeModule } from './logical/syscode/syscode.module';
@Module({
  imports: [
    SequelizeModule.forRoot({
      dialect: 'mysql',
      host: db.mysql.host,
      port: db.mysql.port,
      username: db.mysql.user,
      password: db.mysql.password,
      database: db.mysql.database,
      models: [
        RpAccount,
        AccessoryEntity,
        RoleEntity,
        MenuEntity,
        RoleMenuEntity,
        RoleAccountEntity,
        RpOrgEntity,
        SysCodeEntity,
      ],
    }),
    AuthModule,
    AccountModule,
    AccessoryModule,
    LoginLogModule,
    RoleModule,
    MenuModule,
    OrgModule,
    SysCodeModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
